package router

import (
	"git.oschina.net/fanbuchi/scf-server/domain"
	"git.oschina.net/fanbuchi/scf-server/handler"
	"github.com/gin-gonic/gin"
	"net/http"
	"time"
)
var Router *gin.Engine
func init() {
	// start your server
	Router = gin.Default()
	Router.GET("/", func(context *gin.Context) {
		status:=domain.Rsp{Code:200,Msg:"ok",Data:time.Now()}
		context.JSON(http.StatusOK, status)
	})
	rsa:=new(handler.RsaHandler)
	app:=Router.Group("/scf-server")
	app.POST("/rsa/create", rsa.Create)
	app.POST("/rsa/validate", rsa.Validate)

	config:=new(handler.ConfigHandler)

	app.GET("/config/queryMode",config.QueryMode)


	diskV:=new(handler.DiskVHandler)
	app.POST("/diskv/create",diskV.Create)
	app.GET("/diskv/query",diskV.Query)
}
